﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="InformacaoConta.aspx.cs" Inherits="BYGames.Account.InformaçãoConta" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <h1>Informações de Conta</h1>
    <p>
        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
            DataKeyNames="cpf" DataSourceID="SqlDataSource1" 
            EmptyDataText="There are no data records to display.">
            <Columns>
                <asp:CommandField ShowEditButton="True" />
                <asp:BoundField DataField="email" HeaderText="email" SortExpression="email" />
                <asp:BoundField DataField="senha" HeaderText="senha" SortExpression="senha" />
                <asp:BoundField DataField="nome_cliente" HeaderText="nome_cliente" 
                    SortExpression="nome_cliente" />
                <asp:BoundField DataField="rua" HeaderText="rua" SortExpression="rua" />
                <asp:BoundField DataField="num_end" HeaderText="num_end" 
                    SortExpression="num_end" />
                <asp:BoundField DataField="bairro" HeaderText="bairro" 
                    SortExpression="bairro" />
                <asp:BoundField DataField="cep" HeaderText="cep" SortExpression="cep" />
                <asp:BoundField DataField="cidade" HeaderText="cidade" 
                    SortExpression="cidade" />
                <asp:BoundField DataField="estado" HeaderText="estado" 
                    SortExpression="estado" />
                <asp:BoundField DataField="cpf" HeaderText="cpf" ReadOnly="True" 
                    SortExpression="cpf" />
                <asp:CheckBoxField DataField="status" HeaderText="status" 
                    SortExpression="status" />
            </Columns>
        </asp:GridView>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:masterConnectionString1 %>" 
            DeleteCommand="DELETE FROM [cliente] WHERE [cpf] = @cpf" 
            InsertCommand="INSERT INTO [cliente] ([email], [senha], [nome_cliente], [rua], [num_end], [bairro], [cep], [cidade], [estado], [cpf], [status]) VALUES (@email, @senha, @nome_cliente, @rua, @num_end, @bairro, @cep, @cidade, @estado, @cpf, @status)" 
            SelectCommand="SELECT [email], [senha], [nome_cliente], [rua], [num_end], [bairro], [cep], [cidade], [estado], [cpf], [status] FROM [cliente] WHERE ([cpf] = @cpf)" 
            UpdateCommand="UPDATE [cliente] SET [email] = @email, [senha] = @senha, [nome_cliente] = @nome_cliente, [rua] = @rua, [num_end] = @num_end, [bairro] = @bairro, [cep] = @cep, [cidade] = @cidade, [estado] = @estado, [status] = @status WHERE [cpf] = @cpf">
            <DeleteParameters>
                <asp:Parameter Name="cpf" Type="Int32" />
            </DeleteParameters>
            <InsertParameters>
                <asp:Parameter Name="email" Type="String" />
                <asp:Parameter Name="senha" Type="String" />
                <asp:Parameter Name="nome_cliente" Type="String" />
                <asp:Parameter Name="rua" Type="String" />
                <asp:Parameter Name="num_end" Type="Int32" />
                <asp:Parameter Name="bairro" Type="String" />
                <asp:Parameter Name="cep" Type="Int32" />
                <asp:Parameter Name="cidade" Type="String" />
                <asp:Parameter Name="estado" Type="String" />
                <asp:Parameter Name="cpf" Type="Int32" />
                <asp:Parameter Name="status" Type="Boolean" />
            </InsertParameters>
            <SelectParameters>
                <asp:SessionParameter Name="cpf" SessionField="CPF" Type="Int32" />
            </SelectParameters>
            <UpdateParameters>
                <asp:Parameter Name="email" Type="String" />
                <asp:Parameter Name="senha" Type="String" />
                <asp:Parameter Name="nome_cliente" Type="String" />
                <asp:Parameter Name="rua" Type="String" />
                <asp:Parameter Name="num_end" Type="Int32" />
                <asp:Parameter Name="bairro" Type="String" />
                <asp:Parameter Name="cep" Type="Int32" />
                <asp:Parameter Name="cidade" Type="String" />
                <asp:Parameter Name="estado" Type="String" />
                <asp:Parameter Name="status" Type="Boolean" />
                <asp:Parameter Name="cpf" Type="Int32" />
            </UpdateParameters>
        </asp:SqlDataSource>
    </p>
</asp:Content>
